﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WP7"
                    mc:Ignorable="d">

    <DataTemplate x:Key="RequestDataTemplate">
        <StackPanel Width="456">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="90"></ColumnDefinition>
                    <ColumnDefinition Width="5"></ColumnDefinition>
                    <ColumnDefinition Width="55"/>
                    <ColumnDefinition Width="150"/>
                    <ColumnDefinition Width="150"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="60"></RowDefinition>
                    <RowDefinition Height="30"></RowDefinition>
                    <RowDefinition Height="60"></RowDefinition>
                    <RowDefinition Height="30"></RowDefinition>
                    <RowDefinition Height="30"></RowDefinition>
                    <RowDefinition Height="30"></RowDefinition>
                    <RowDefinition Height="30"></RowDefinition>
                    <RowDefinition Height="60"></RowDefinition>
                    <RowDefinition Height="10"></RowDefinition>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <TextBlock Text="Identifier:" />
                <TextBlock Text="{Binding Identifier}" Foreground="{Binding State, Converter={StaticResource FileRequestStateToColourConverter}}"
                               TextAlignment="Left" Padding="0,0,20,0" Grid.Column="1" Grid.ColumnSpan="4" Margin="0,0,-5,0" TextWrapping="Wrap" />
                <TextBlock Text="Created:" Grid.Row="1" />
                <TextBlock Text="{Binding CreatedOn}" Foreground="{Binding State, Converter={StaticResource FileRequestStateToColourConverter}}"
                               TextAlignment="Left" Padding="0,0,20,0" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="4" />
                <TextBlock Text="Url:" Grid.Row="2" />
                <TextBlock Text="{Binding Url}" Foreground="{Binding State, Converter={StaticResource FileRequestStateToColourConverter}}"
                               TextAlignment="Left" Padding="0,0,20,0" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="4" TextWrapping="Wrap" />
                <TextBlock Text="Dir:" Grid.Row="3" />
                <TextBlock Text="{Binding FilePath, Converter={StaticResource DirFromFilePathConverter}}" Foreground="{Binding State, Converter={StaticResource FileRequestStateToColourConverter}}"
                               TextAlignment="Left" Padding="0,0,20,0" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="4" />
                <TextBlock Text="File:" Grid.Row="4" />
                <TextBlock Text="{Binding FilePath, Converter={StaticResource FileFromFilePathConverter}}" Foreground="{Binding State, Converter={StaticResource FileRequestStateToColourConverter}}"
                               TextAlignment="Left" Padding="0,0,20,0" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="4" />
                <TextBlock Text="Size:" Grid.Row="5" />
                <TextBlock Text="{Binding FileLength, Converter={StaticResource FileLengthToStringConverter}}" Foreground="{Binding State, Converter={StaticResource FileRequestStateToColourConverter}}"
                               TextAlignment="Left" TextWrapping="Wrap" Padding="0,0,20,0" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="4" />
                <TextBlock Text="State:" Grid.Row="6" />
                <TextBlock Text="{Binding State}" Foreground="{Binding State, Converter={StaticResource FileRequestStateToColourConverter}}"
                               TextAlignment="Left" Padding="0,0,20,0" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="4" />
                <Button Grid.Row="7"
                        Grid.ColumnSpan="3"
                        Content="Delete"
                        cmd:ButtonBaseExtensions.Command="{Binding MainViewModel.PrimaryItemCommand, Source={StaticResource Locator}}"
                        cmd:ButtonBaseExtensions.CommandParameter="{Binding .}"
                        FontSize="{StaticResource PhoneFontSizeSmall}"
                        Margin="0,0,0,0"/>
                <Button Grid.Column="3"
                        Grid.Row="7" 
                        Content="{Binding ., Converter={StaticResource FileRequestToButtonContentConverter}}"
                        cmd:ButtonBaseExtensions.Command="{Binding MainViewModel.SecondaryItemCommand, Source={StaticResource Locator}}"
                        cmd:ButtonBaseExtensions.CommandParameter="{Binding .}"
                        FontSize="{StaticResource PhoneFontSizeSmall}"
                        Margin="0,0,0,0" />
                <Button Grid.Column="4"
                        Grid.Row="7" 
                        Content="Prioritise"
                        cmd:ButtonBaseExtensions.Command="{Binding MainViewModel.TertiaryItemCommand, Source={StaticResource Locator}}"
                        cmd:ButtonBaseExtensions.CommandParameter="{Binding .}"
                        FontSize="{StaticResource PhoneFontSizeSmall}"
                        Margin="0,0,0,0"/>
            </Grid>
        </StackPanel>
    </DataTemplate> 
    
</ResourceDictionary>
    
    